#include<stdio.h>
#include<math.h>
int judgement(int n)
{
	int i, k, judge;
	judge = 1;
	k = (int)sqrt(n);
	if (n == 1) judge = 0;
	for (i = 2; judge || i <= k; i++)
	{
		if (n % i == 0) judge = 0;
	}
	return judge;
}
int main(void)
{
	int n, a;
	scanf_s("%d", &n);
	a = judgement(n);
	printf("%d", a);
}